home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-26 | 3.2 KB | 59 lines | [TEXT/$Tcl] |
-
-
- convertclock dateString ?GMT|{}? ?baseClock?
- Convert dateString to an integer clock value (see
- getclock). This command can parse and convert virtu-
- ally any standard date and/or time string, which can
- include standard time zone mnemonics. If only a time
- is specified, the current date is assumed. If the
- string does not contain a time zone mnemonic, the local
- time zone is assumed, unless the GMT argument is speci-
- fied, in which case the clock value is calculated
- assuming that the specified time is relative to
- Greenwich Mean Time. If baseClock is specified, it is
- taken as the current clock value. This is useful for
- determining the time on a specific day.
-
- The character string consists of zero or more specifi-
- cations of the following form:
-
- time - A time of day, which is of the form hh[:mm[:ss]]
- [meridian] [zone] or hhmm [meridian] [zone]. If no
- meridian is specified, hh is interpreted on a 24-hour
- clock.
-
- date - A specific month and day with optional year.
- The acceptable formats are mm/dd[/yy], yyyy/mm/dd,
- monthname dd[, yy], dd monthname [yy], and day, dd
- monthname yy. The default year is the current year.
- If the year is less then 100, then 1900 is added to it.
-
- relative time - A specification relative to the current
- time. The format is number unit; acceptable units are
- year, fortnight, month, week, day, hour, minute (or
- min), and second (or sec). The unit can be specified
- as a singular or plural, as in 3 weeks. These modif-
- iers may also be specified: tomorrow, yesterday, today,
- now, last, this, next, ago.
-
- The actual date is calculated according to the follow-
- ing steps. First, any absolute date and/or time is
- processed and converted. Using that time as the base,
- day-of-week specifications are added. Next, relative
- specifications are used. If a date or day is speci-
- fied, and no absolute or relative time is given, mid-
- night is used. Finally, a correction is applied so
- that the correct hour of the day is produced after
- allowing for daylight savings time differences.
-
- convertclock ignores case when parsing all words. The
- names of the months and days of the week can be abbre-
- viated to their first three letters, with optional
- trailing period. Periods are ignored in any timezone
- or meridian values. The only dates in the range 1902
- and 2037 may be converted. Some examples are:
-
- convertclock "14 Feb 92"
- convertclock "Feb 14, 1992 12:20 PM PST"
- convertclock "12:20 PM Feb 14, 1992"
-